package com.cms.jdbc;

import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import com.sun.net.httpserver.Authenticator.Result;

public class Test {
	public static void main(String[] args) throws IntrospectionException {
		/*Class c=CustomerSQL.class;
		Field[] declaredFields = c.getDeclaredFields();
		
		
		
		for (Field field : declaredFields) {
			PropertyDescriptor pd=new PropertyDescriptor(field.getName(), c);
			System.out.println(field.getName());
			Method m = pd.getWriteMethod();
			System.out.println(m.getName());
			
		}*/
		
		/*try {
			Class.forName("com.mysql.jdbc.Driver");
			String url="jdbc:mysql://localhost:3306/test";
			String user="root";
			String password="a123456";
			Connection conn=DriverManager.getConnection(url, user, password);
			Statement sta=conn.createStatement();
			ResultSet res=sta.executeQuery("select * from customer");
			Method method = ResultSet.class.getMethod("getString")
			
			System.out.println(method.invoke(res, "id"));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		
		
		try {
			Class.forName("com.mysql.jdbc.Driver");
			String url="jdbc:mysql://localhost:3306/javatest";
			String user="root";
			String password="a123456";
			Connection conn=DriverManager.getConnection(url, user, password);
			Statement sta=conn.createStatement();
			

		
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
